﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="enforcer-results" type="results-type"/>
    
  <xs:complexType name="results-type">
    <xs:sequence>
      <xs:element name="element" type="element-type" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="element-type">
    <xs:sequence>
      <xs:element name="code-element" type="code-element-type" minOccurs="1" maxOccurs="1"/>
      <xs:element name="errors" type="errors-type" minOccurs="1" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="code-element-type">
    <xs:attribute name="name" use="required"/>
    <xs:attribute name="declaring-type" use="optional"/>
  </xs:complexType>

  <xs:complexType name="errors-type">
    <xs:sequence>
      <xs:element name="pattern" type="pattern-errors-type" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="pattern-errors-type">
    <xs:sequence>
      <xs:element name="error" type="xs:string" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="name" use="required"/>
  </xs:complexType>
</xs:schema>
